﻿using Joy.Erp.BasicArchives.ItemMasters;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;

namespace Joy.Erp.BasicArchives.Core
{
    [RemoteService(Name = BasicArchivesRemoteServiceConsts.RemoteServiceName)]
    [Area(BasicArchivesRemoteServiceConsts.ModuleName)]
    [ControllerName("UniqueCodeSetting")]
    [Route("api/basic-archives/unique-code-setting")]
    public class UniqueCodeSettingController : BasicArchivesController, IUniqueCodeSettingAppService
    {
        protected IUniqueCodeSettingAppService UniqueCodeSettingAppService => LazyServiceProvider.LazyGetRequiredService<IUniqueCodeSettingAppService>();
        [HttpGet]
        [Route("{key}")]
        public Task<UniqueCodeSettingDto> GetAsync(string key)
        {
            return UniqueCodeSettingAppService.GetAsync(key);
        }

        [HttpPut]
        [Route("{key}")]
        public Task UpdateAsync(string key, UniqueCodeSettingDto value)
        {
            return UniqueCodeSettingAppService.UpdateAsync(key, value);
        }

        [HttpGet]
        [Route("get-options")]
        public Task<UniqueCodeOptionsDto> GetOptionsAsync()
        {
            return UniqueCodeSettingAppService.GetOptionsAsync();
        }
    }
}
